﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace DemoGame1
{
    public class Cell : VisibleGameEntity
    {
        public Cell()
        {
        }

        public Cell(ContentManager content, string strCelTexture,Vector2 topleft,Vector2 size)
        {
            TopLeft = topleft;
            Size = size;
         
            Texture2D[] textures = new Texture2D[1];
            textures[0] = content.Load<Texture2D>(strCelTexture);
            Sprites = new List<My2DSprite>();
            My2DSprite tempSprite = new My2DSprite(textures, topleft);
            tempSprite.Size = size;
            Sprites.Add(tempSprite);
            nSprites = 1;
        }

        public override void Draw(SpriteBatch sb, GameTime gameTime)
        {
            if (Visible == true)
            {
                for (int i = 0; i < nSprites; i++)
                {
                    sprites[i].Draw(sb, gameTime, _TopLeft, _Size);
                }
            }
        }
        public override void Draw(SpriteBatch sb, GameTime gameTime, Vector2 _TopLeft, Vector2 _Size)
        {
            for (int i = 0; i < nSprites; i++)
            {
                sprites[i].Draw(sb, gameTime, _TopLeft, _Size);
            }
        }
    }
}
